// vs
float4x4 matWorld;
float4x4 matViewProjection;
struct VS_INPUT
{
	float3 Pos : POSITION;
	float3 Normal : NORMAL;
};

struct VS_OUTPUT
{
	float4 Pos : POSITION;
	float3 PosInWorld : TEXCOORD0;
	float3 NormalInWorld : TEXCOORD1;
};

VS_OUTPUT vs_main(VS_INPUT In)
{
	VS_OUTPUT Out;
	Out.PosInWorld = mul(matWorld, float4(In.Pos, 1.0)).xyz;
	Out.NormalInWorld = mul(matWorld, float4(In.Normal, 1.0)).xyz;
	Out.Pos = mul(matViewProjection, float4(In.Pos, 1.0));
	return Out;
}

//ps-----------
struct PS_INPUT
{
	float3 PosInWorld : TEXCOORD0;
	float3 NormalInWorld : TEXCOORD1;
};

struct PS_OUTPUT
{
	float4 Color	  : COLOR0;
	float4 PosInWorld : COLOR1;
	float4 NormalInWorld : COLOR2;
};

PS_OUTPUT ps_main(PS_INPUT In)
{
	PS_OUTPUT Out;
	Out.Color	= float4(1.0, 0.0, 0.0, 0.0);
	Out.PosInWorld = float4(In.PosInWorld, 1.0);
	Out.NormalInWorld = float4(In.NormalInWorld, 1.0);
	return Out;
}

technique defer_tech
{ 
	pass p0
	{ 
		VertexShader = compile vs_3_0 vs_main();
        PixelShader = compile ps_3_0 ps_main();
	}
}
